<%@ page import="com.news.db.OpDB" %>
<%@ page import="com.news.model.News" %>
<%@ page import="java.util.ArrayList" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>新闻列表</title>
</head>
<body>
<table border="0" width="700" height="500" cellspacing="0" cellpadding="0" align="right">
    <tr>
        <td align="center">
            <table border="1" width="690" height="480" cellspacing="0" cellpadding="0" rules="rows">
                <tr>
                    <td align="center">
                        <table border="0" cellpadding="0" cellspacing="0" width="685" href="475">
                            <%
                                int info_type = Integer.parseInt(request.getParameter("info_type"));
                                String title = "";
                            %>
                            <tr>
                                <td colspan="2"><font style="font-family:黑体;font-size:20px;">
                                    <%
                                        switch (info_type){
                                            case 1:title="☞科技新闻☜";break;
                                            case 2:title="☞游戏新闻☜";break;
                                            case 3:title="☞房产新闻☜";break;
                                            case 4:title="☞财经新闻☜";break;
                                            case 5:title="☞娱乐新闻☜";break;
                                        }
                                    %>
                                    <%=title%>
                                    </font></td>
                                <td><a href="#" >返回&gt;&gt;</a></td>
                            </tr>
                            <%
                                OpDB op = new OpDB();
                                ArrayList<News> list = op.OpGetNews(info_type,null);
                                if(list != null && list.size() >0){
                                    for(int i = 0; i < list.size(); i++) {
                                        News n = list.get(i);
                            %>
                            <tr>
                                <td>
                                    <font style="font-family:黑体;font-size:16px;">
                                        <a href="view/news_info.jsp?id=<%=n.getId()%>"><%=n.getInfo_title()%></a>
                                    </font>
                                </td>
                                <td><%=n.getInfo_date()%></td>
                                <td><%=n.getInfo_creator()%></td>
                            </tr>
                            <%
                                    }
                                }
                            %>
                        </table>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
</body>
</html>